﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<iBuproModel.Subject>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%:Html.Translate("subjects") %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%:Html.Translate("subjects") %></h2>

    <table>
     <thead>
        <tr>
            <th></th>
            <th>
                <%:Html.Translate("name") %>
            </th>
            <th>
                <%:Html.Translate("shortcut") %>
            </th>
            <th>
                <%:Html.Translate("department") %>
            </th>
            <th>
                <%:Html.Translate("visibility") %>
            </th>
            <th>
                <%:Html.Translate("projects") %>
            </th>
        </tr>
    </thead>
    <tbody>
    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink(Html.Translate("edit"), "Edit", new { id=item.Id }) %> |
                <%: Html.ActionLink(Html.Translate("delete"), "Delete", new { id=item.Id })%>
            </td>
            <td>
                <%: item.Name %>
            </td>
            <td>
                <%: item.Shortcut %>
            </td>
            <td>
                <% if (item.Department != null)
                   {  %>
                    <%:item.Department.Name%>
                <% }
                   else
                   {%>
                    Not in department
                <%} %>

            </td>
            <td>
                <%: item.Visible %>
            </td>
            <td>
                <%:Html.ActionLink(Html.Translate("projects"), "Filter","Project", new {id = item.Id },null)%>
            </td>
        </tr>
    
    <% } %>
    </tbody>
    </table>

    
    <p>
        <%: Html.ActionLink(Html.Translate("createNew"), "Create") %>
    </p>

</asp:Content>

